from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout
from django.views.generic.simple import direct_to_template

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from igs.wt.views import index, register, uploadCSV, datosAdAcC, datosAdAcL, datosAdAcSC
from igs.gc.views import *

urlpatterns = patterns('',
    # Example:
    # (r'^wt/', include('igs.wt.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    (r'^$', index),
    (r'^accounts/$',  login),
    (r'^accounts/logout/$', logout),
    (r'^accounts/profile/$', index),
    (r'^accounts/regsuccess', direct_to_template, {'template': 'registration/regsuccess.html'}),
    (r'^accounts/register/$', register),
    (r'^interpretar/$', 'index'),
    (r'^interpretar/subir/$', uploadCSV),
    (r'^interpretar/daac/$', datosAdAcC),
    (r'^interpretar/daasc/$', datosAdAcSC),
    (r'^interpretar/daal/$', datosAdAcL),
    (r'^ecuaciones/$', gc),
    (r'^ecuaciones/permconf/$', calcPozoPermAcC),
    (r'^ecuaciones/permsemiconf/$', calcPozoPermAcSC),
    (r'^ecuaciones/permlibre/$', calcPozoPermAcL),
    (r'^ecuaciones/nopermconf/$', calcPozoNoPermAcC),
    (r'^ecuaciones/nopermsemiconf/$', calcPozoNoPermAcSC),
    (r'^ecuaciones/nopermlibre/$', calcPozoNoPermAcL),
)

if settings.SERVE_MEDIA_FILES:
    urlpatterns += patterns('',
            (r'^igs/media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )
